package com.test.designPattern.structuralType.decoratorPattern;

/**
 * 加冰
 *
 * @author wangjie
 * @version V1.0
 * @date 2020/4/7
 */
public class AddIceTaste extends Taste{

    private int pri = 5;
    private String name = "加冰";
    private MilkTea tea = null;

    public AddIceTaste(MilkTea tea){
        this.tea = tea;
    }

    @Override
    public String milkTeaName() {
        return name + tea.milkTeaName();
    }

    @Override
    public int milkTeaPrice() {
        return tea.milkTeaPrice()+pri;
    }

}
